package com.jd.xsl.field;

public class DatetimeFormat extends FieldFormat {

	private static final long serialVersionUID = 212221266632042383L;
	private String pattern;
	private boolean autoCorrect;

	/**
	 * @return the pattern
	 */
	public String getPattern() {
		return pattern;
	}

	/**
	 * @param pattern the pattern to set
	 */
	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

	/**
	 * @return the autoCorrect
	 */
	public boolean isAutoCorrect() {
		return autoCorrect;
	}

	/**
	 * @param autoCorrect the autoCorrect to set
	 */
	public void setAutoCorrect(boolean autoCorrect) {
		this.autoCorrect = autoCorrect;
	}

	@Override
	public String toString(){
		StringBuilder builder = new StringBuilder("{");

		builder.append("\"type\":\"number\"");

		builder.append(", \"pattern\":\"").append(pattern).append("\"");
		builder.append(", \"autoCorrect\":").append(autoCorrect);

		return builder.append("}").toString();
	}
}
